<h1>Listing exams</h1>

<table>
  <tr>
    <th>Title</th>
    <th>Teacher</th>
  </tr>
  
<% for exam in @exams %>
  <tr>
    <td><%=h exam.title %></td>
    <td><%=h exam.user.last_name %></td>
    <td><%= link_to 'Take', { :action => 'take', :id => exam }, :confirm => 'Are you sure?', :method => :post %></td>
  </tr>
<% end %>
</table>

<%= link_to 'Previous page', { :page => @exam_pages.current.previous } if @exam_pages.current.previous %>
<%= link_to 'Next page', { :page => @exam_pages.current.next } if @exam_pages.current.next %> 

<br />

